package com.example.xxpk.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.xxpk.bo.OutfitInfo;
import com.example.xxpk.pojo.UserOutifts;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhangguihong
 * @since 2025-02-13
 */
public interface UserOutiftsMapper extends BaseMapper<UserOutifts> {


    @Select("SELECT o.*, uo.user_id, uo.outifts_id, uo.category as userOutiftsCategory, uo.acquired_time, uo.level, uo.experience, uo.status, uo.is_using " +
            "FROM outifts o " +
            "LEFT JOIN user_outifts uo ON o.outifts_id = uo.outifts_id AND uo.user_id = #{userId} " +
            "WHERE o.category = #{category} AND o.is_displayed = 1")
    List<OutfitInfo> getOutfitInfoByUserIdAndCategory(Integer userId, String category);
}
